package com.piggy.sys.api;

import com.piggy.common.core.constant.SecurityConstants;
import com.piggy.common.core.constant.ServiceNameConstants;
import com.piggy.common.core.domain.R;
import com.piggy.sys.api.factory.RemoteDistrictFallbackFactory;
import com.piggy.sys.api.vo.BaseAddressVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 用户服务
 *
 * @author shark
 */
@FeignClient(contextId = "remoteDistrictService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDistrictFallbackFactory.class)
public interface RemoteDistrictService {

    @GetMapping("/base/address/getDistrictInfo/{districtId}")
    R<BaseAddressVo> getDistrictVo(@PathVariable("districtId") String districtId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/base/address/getDistrictMap")
    R<Map<String, String>> getDistrictMap(@RequestParam("districtIds") List<String> districtIds, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
